#include <bits/stdc++.h>
using namespace std;

const int N = 30;
int n, m, t, c[N][N];
string s;
int dp[1 << 21][N];//表示字符打印的状态为i且光标在第j个字母后面的最小的消耗
int get(char c) {
    return c - 'a';
}
signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin >> n >> m >> t;
    cin >> s;
    memset(dp, 0x3f, sizeof dp);
    for (int i = 0; i <= m - 1; i++) for (int j = 0; j <= m - 1; j++) cin >> c[i][j];
    int maxn = (1 << n) - 1;
    for (int i = 0; i <= maxn; i++) {//枚举每个字符是否完成
        for (int j = 0; j < n; j++) {
            if ((i >> j) == 0) continue;
            if (i == (1 << j)) dp[i][j] = c[0][get(s[j])];//初始化
            int cnt = 1;
            for (int k = j - 1; k >= 0; k--) {
                int& x = dp[i | (1 << k)][k];
                if (i >> k & 1) cnt++;
                else x = min(x, dp[i][j] + cnt * t + c[get(s[j])][get(s[k])]);
            }
            cnt = 0;
            for (int k = j + 1; k < n; k++) {
                int& x = dp[i | (1 << k)][k];
                if (i >> k & 1) cnt++;
                else x = min(x, dp[i][j] + cnt * t + c[get(s[j])][get(s[k])]);
            }
        }
    }
    cout << n * t + *min_element(dp[maxn], dp[maxn] + n);
    return 0;
}
